'
' DotNetNukeŽ - http://www.dotnetnuke.com
' Copyright (c) 2002-2006
' by DotNetNuke Corporation
'
' Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 
' documentation files (the "Software"), to deal in the Software without restriction, including without limitation 
' the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and 
' to permit persons to whom the Software is furnished to do so, subject to the following conditions:
'
' The above copyright notice and this permission notice shall be included in all copies or substantial portions 
' of the Software.
'
' THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 
' TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
' THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 
' CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
' DEALINGS IN THE SOFTWARE.
'

Imports DotNetNuke
Imports DotNetNuke.Common
Imports DotNetNuke.Security.Roles
Imports DotNetNuke.Security.Membership
Imports System.Collections.Generic
Imports DotNetNuke.Entities.Portals
Imports DotNetNuke.Security.PortalSecurity

Namespace DotNetNuke.Modules.IWeb

    Partial Class IWeb
        Inherits DotNetNuke.Entities.Modules.PortalModuleBase

        Protected Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                lnkDownload.NavigateUrl = "~/DesktopModules/IWeb/client/IWeb_Core_Connector_Client.msi"
                lnkDownload2.NavigateUrl = "~/DesktopModules/IWeb/client/IWeb_Core_Connector_source.zip"

                If Not Entities.Users.UserController.GetCurrentUserInfo.IsSuperUser Then
                    lnkConfigure.Enabled = False
                    lnkConfigure.Text = "Only Host (Super User) can configure IWeb"
                    If Not IsInRole("Administrators") Then
                        lnkConfigure.Visible = False
                    End If
                End If

                Dim strHost As String = PortalController.GetCurrentPortalSettings.HomeDirectory.ToString()

                WebService_HyperLink.Text = "DesktopModules/IWeb/webservice.asmx"
                WebService_HyperLink.NavigateUrl = "~/DesktopModules/IWeb/webservice.asmx"

                If Not Page.IsPostBack Then
                    Dim colPortalController As New PortalController()
                    gvPortalList.DataSource = colPortalController.GetPortals()
                    gvPortalList.DataBind()
                End If

            Catch exc As Exception        'Module failed to load
                ProcessModuleLoadException(Me, exc)
            End Try
        End Sub
        
        Protected Sub lnkConfigure_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkConfigure.Click
            Dim objModules As Entities.Modules.ModuleController = New Entities.Modules.ModuleController
            Response.Redirect(Globals.NavigateURL(PortalSettings.ActiveTab.TabID, "configure", "mid=" & CStr(ModuleId)))
        End Sub
    End Class

End Namespace